import request from '@/utils/request'

// 根据车辆分类或校园或车商查询轮播图
export function getBannersApi(categoryId, campusOrShopType) {
  return request({
    url: `/banner/list`,
    params: {
      categoryId,
      campusOrShopType
    }
  })
}

// 添加轮播图
export function addBannerApi(data) {
  return request({
    url: 'banner/add',
    method: 'post',
    data
  })
}

// 编辑轮播图
export function modifyBannerApi(data) {
  return request({
    url: 'banner/modify',
    method: 'put',
    data
  })
}

// 删除图片
export function deleteBannerApi(id) {
  return request({
    url: `/banner/delete/${id}`,
    method: 'delete'
  })
}
